import Vue from 'vue'
import Router from 'vue-router'
import Index from '@/components/index2.vue'
import UserList from '@/components/userSelect.vue'
import UserInfo from '@/components/userInfo.vue'
import ImgList from '@/components//ImgList.vue'
import UploadImg from '@/components/uploadImg.vue'
import Login from '@/views/login/login.vue'
import Main from '@/views/main/main.vue'
import Home from '@/views/home/home.vue'

Vue.use(Router)


export default new Router({
  routes: [{
      path: '/',
      name: 'Login',
      component: Login
    },
    {
      path: '/main',
      name: 'Main',
      component: Main
    },
    {
      path: '/home',
      name: 'Home',
      component: Home,
      children: [{
        path: "/home/index",
        component: Index,
        children: [{
          path: "/home/index/userList",
          component: UserList
        }, {
          path: "/home/index/imgList",
          component: ImgList
        }, {
          path: "/home/index/userInfo",
          component: UserInfo
        }, {
          path: "/home/index/uploadImg",
          component: UploadImg
        }, {
          path: '/home',
          redirect: '/home/index/userList'
        }]
      }]
    }
  ]
})
